<?php
/**
 * Statuses Model for Congregation Component
 * 
 * @package    Congregation
 * @subpackage Components
 * @link http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_4
 * @license		GNU/GPL
 */

// No direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

jimport('joomla.application.component.model');

/**
 * Sharing Sharing Model
 *
 * @package    Joomla.Tutorials
 * @subpackage Components
 */
class CongregationModelStatuses extends CongregationModel
{

	var $_data;


  /**
   * Returns the query for listing the statuses
   *
   * @access  protected
   * @return  string    The query to be used to retrieve the statuses data from the database
   * @since   1.5.5
   */
  function _buildQuery()
  {
	
	
    $query = "SELECT * FROM #__congregation_status ORDER BY ordering";
	
	

    return $query;
  }


	/**
	* Method to get status list 
	*
	*/

	
	function getData()
	{
		// Lets load the data if it doesn't already exist
		if (empty( $this->_data ))
		{
			
			$query = $this->_buildQuery();
			
			$this->_db->setQuery( $query );
			
			$this->_data = $this->_getList( $query );
			
		}

		return $this->_data;
	
	}
	
		/**
		* Method to get the total number of statuses
		*
		* @access  public
		* @return  int     The total number of categories
		* @since   1.5.5
		*/
		function getTotal()
		{
		// Let's load the number of categories if it doesn't already exist
		if (empty($this->_total))
		{
			$query = $this->_buildQuery();
		  
			$this->_total = $this->_getListCount($query);
			
		}

		return $this->_total;
		}


}